// src/api/endpoints.js
import http from './api.js';

export const request = (url, method, params) => {
  switch (method.toLowerCase()) {
    case 'get':
      return http.get(url, { params });
    case 'post':
      return http.post(url, params);
    case 'delete':
      return http.delete(url, { params });
    case 'put':
      return http.put(url, params);
    case 'patch':
      return http.patch(url, params);
    default:
      return Promise.reject(new Error('Unsupported method: ' + method));
  }
};
